package com.demandbreakdown.xiyun.common.constant;

/**
 * 文件和OSS相关常量
 *
 * @author poxz
 */
public final class FileConstant {

    // ========== 文件通用配置 ==========

    /**
     * 默认文件扩展名
     */
    public static final String DEFAULT_EXTENSION = "jpg";

    /**
     * 日期路径格式
     */
    public static final String DATE_PATH_FORMAT = "yyyy/MM/dd";

    // ========== Content-Type ==========

    /**
     * Content-Type: image/jpeg
     */
    public static final String CONTENT_TYPE_JPEG = "image/jpeg";

    /**
     * Content-Type: image/png
     */
    public static final String CONTENT_TYPE_PNG = "image/png";

    /**
     * Content-Type: image/gif
     */
    public static final String CONTENT_TYPE_GIF = "image/gif";

    /**
     * Content-Type: image/webp
     */
    public static final String CONTENT_TYPE_WEBP = "image/webp";

    /**
     * Content-Type: image/bmp
     */
    public static final String CONTENT_TYPE_BMP = "image/bmp";

    /**
     * Content-Type: image/tiff
     */
    public static final String CONTENT_TYPE_TIFF = "image/tiff";

    /**
     * Content-Type: image/svg+xml
     */
    public static final String CONTENT_TYPE_SVG = "image/svg+xml";

    /**
     * Content-Type: application/octet-stream (默认)
     */
    public static final String CONTENT_TYPE_OCTET_STREAM = "application/octet-stream";

    // ========== Cache Control ==========

    /**
     * 缓存控制：1年
     */
    public static final String CACHE_CONTROL_ONE_YEAR = "max-age=31536000";

    // ========== 下载URL配置 ==========

    /**
     * 下载URL有效期（毫秒）：1小时
     */
    public static final long DOWNLOAD_URL_EXPIRE_MS = 3600 * 1000;

    // ========== HTTP 状态码 ==========

    /**
     * HTTP状态码：404 Not Found
     */
    public static final int HTTP_STATUS_NOT_FOUND = 404;

    /**
     * HTTPS协议前缀长度（用于URL解析）
     * "https://" 的长度为8
     */
    public static final int HTTPS_PROTOCOL_PREFIX_LENGTH = 8;

    // 私有构造函数，防止实例化
    private FileConstant() {
        throw new UnsupportedOperationException("常量类不能被实例化");
    }
}

